// 专门处理时间的方法
import dayjs from 'dayjs'
import relativeTime from 'dayjs/plugin/relativeTime'
import 'dayjs/locale/zh'

export const timeAgo = (targetTime) => {
  dayjs.extend(relativeTime)
  dayjs.locale('zh')
  const timeA = dayjs()
  const timeB = dayjs(targetTime)
  // return timeA.to(timeB)
  return timeA.to('2022-10-26')
}
